com.highdeal.pnr.hci
Class InvalidItemException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.highdeal.hci.OperationFailureException
              extended by com.highdeal.pnr.hci.InvalidItemException
All Implemented Interfaces:
OperationResult, XMLMarshallable, IChargingResultHolderException, java.io.Serializable

public class InvalidItemException
extends OperationFailureException
implements IChargingResultHolderException

Exception thrown when the rating and charging context is invalid in the connected SAP CC system when processing a business operation. This exception relates to a problem between:

Important Notes

Reasons

The possible reasons are:

Failure Reason Code Reason Code (HCI) Customizing and Integration Troubleshooting (Next Steps)
Bad configuration 0 badConfiguration

Note

To design the exception and error handling functions (automated treatments, logging and manual treatments), see the Field Detail section in this topic.

Refer to the information available in the Customizing subsection of each failure to develop your integration code.

Note

For troubleshooting investigations, see the Field Detail section in this topic.

Refer to the information available in the Next Steps subsection of each failure.

Wrong property type 1 wrongPropertyType
Property not found 2 propertyNotFound
Division by zero 4 divisionByZero
Incompatible currencies 5 incompatibleCurrencies
Chargeable item (CI) null 6 nullChargeableItem
Invalid property 7 invalidPropertyValue
Unrated (deprecated and now revoked) 3 unrated

Consider the detailed information in the Field Detail section in this topic.

Tip

For troubleshooting during the implementation of SAP Converent Charging, see the SAP CC Error Code Reference in the SDK or in SAP Help Portal.

Implementation in Your Client Application

Exception and Error Handling

Depending on your business requirements, design and develop the handling functions in your client application.

See Also:
Error Code Reference, Serialized Form

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="invalidItemFault">
   <xs:complexType>
    <xs:sequence>
       <xs:element ref="cause" minOccurs="0" maxOccurs="1"/>  <!-- Due to legacy use of this exception, no error may be provided -->
       <xs:element ref="causedBy" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="error" type="InvalidItemFaultErrorType"/>
    <xs:attribute name="message" type="xs:string"/>
   </xs:complexType>
  </xs:element>
  <xs:simpleType name="InvalidItemFaultErrorType">
   <xs:restriction base="xs:string">
      <xs:enumeration value="notAuthorized"/>
      <xs:enumeration value="badConfiguration"/>
      <xs:enumeration value="wrongPropertyType"/>
      <xs:enumeration value="propertyNotFound"/>
      <xs:enumeration value="unrated"/>  <!-- deprecated -->
      <xs:enumeration value="divisionByZero"/>
      <xs:enumeration value="incompatibleCurrencies"/>
      <xs:enumeration value="nullChargeableItem"/>
      <xs:enumeration value="invalidPropertyValue"/>
   </xs:restriction>
  </xs:simpleType>


Field Summary
static int BAD_CONFIGURATION
          0: Error when the price plan is badly configured in the pricing catalog (in master data) configured in the connected SAP CC system.
static int CI_NULL
          6: Error when the chargeable item (CI) is null or its name is null.
static int DIVISION_BY_ZERO
          4: Error when a division by zero occured during the processing.
static int INCOMPATIBLE_CURRENCIES
          5: Error when currencies are not compatible; This kind of error happens when there is a mismatch between the currency of the account and the currency declared at the charge level.
static int INVALID_PROPERTY_VALUE
          7: Error when a property of the rating context has an invalid value.
static int NOT_AUTHORIZED
          -1: Error when a no access is raised when executing a price plan in a charge configured in master data.
static int PROPERTY_NOT_FOUND
          2: Error when a property is not found in the rating context.
static int UNRATED
          Deprecated. This reason code is deprecated and can no longer be returned
static int WRONG_PROPERTY_TYPE
          1: Error when a property in the rating context of the charging operation request does not have the right type.
 
Constructor Summary
InvalidItemException()
          Constructs an empty exception.
InvalidItemException(int reason, java.lang.String message)
          Constructs an exception with an error code and a message; The message contains a human readable text.
InvalidItemException(int reason, java.lang.String message, ChargingResult chargingResult)
          Constructs an exception with an error code and a message; The message contains a human readable text.
InvalidItemException(int reason, java.lang.String message, IError error)
          Constructs an exception with an error code and a message; The message contains a human readable text.
InvalidItemException(int reason, java.lang.String message, IError error, ChargingResult chargingResult)
          Constructs an exception with a cause, a message, an error, and a ChargingResult that explain why the charging is forbidden.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 ChargingResult getChargingResult()
          Returns the ChargingResult that provides structured information about the exception.
 int getError()
          Deprecated. Use getReason() instead. Deprecated since version 3.0.
 IError getIError()
          Gets the error contained in this Exception.
 java.lang.String getMessage()
          Returns the detailed message explaining why the rating context is invalid.
 int getReason()
          Returns the reason why the rating context is invalid.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setError(IError error)
          Sets the error contained in this Exception.
 
Methods inherited from class com.highdeal.hci.OperationFailureException
getOperandReference
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOT_AUTHORIZED

public static final int NOT_AUTHORIZED
-1: Error when a no access is raised when executing a price plan in a charge configured in master data.

See Also:
Constant Field Values

BAD_CONFIGURATION

public static final int BAD_CONFIGURATION
0: Error when the price plan is badly configured in the pricing catalog (in master data) configured in the connected SAP CC system.
Next Steps

Use the same inputs in the rating context that generates such error and use the trial run tool in the SAP CC Core Tool user interface to detect the price plan component in error and correct the configuration accordingly.

See Also:
Constant Field Values

WRONG_PROPERTY_TYPE

public static final int WRONG_PROPERTY_TYPE
1: Error when a property in the rating context of the charging operation request does not have the right type.
Detailed Information

This kind of error might come when there is a mismatch between the type of the property declared in the chargeable item class and the one sent in the chargeable item.

Next Steps

See Also:
Constant Field Values

PROPERTY_NOT_FOUND

public static final int PROPERTY_NOT_FOUND
2: Error when a property is not found in the rating context.

See Also:
Constant Field Values

UNRATED

@Deprecated
public static final int UNRATED
Deprecated. This reason code is deprecated and can no longer be returned
3: Error when the input chargeable item (CI) is not rated by executing the price plan.

See Also:
Constant Field Values

DIVISION_BY_ZERO

public static final int DIVISION_BY_ZERO
4: Error when a division by zero occured during the processing.

See Also:
Constant Field Values

INCOMPATIBLE_CURRENCIES

public static final int INCOMPATIBLE_CURRENCIES
5: Error when currencies are not compatible; This kind of error happens when there is a mismatch between the currency of the account and the currency declared at the charge level.
Next Steps

See Also:
Constant Field Values

CI_NULL

public static final int CI_NULL
6: Error when the chargeable item (CI) is null or its name is null.

See Also:
Constant Field Values

INVALID_PROPERTY_VALUE

public static final int INVALID_PROPERTY_VALUE
7: Error when a property of the rating context has an invalid value.

See Also:
Constant Field Values
Constructor Detail

InvalidItemException

public InvalidItemException()
Constructs an empty exception.


InvalidItemException

public InvalidItemException(int reason,
                            java.lang.String message)
Constructs an exception with an error code and a message; The message contains a human readable text.

Parameters:
message - The message
reason - The error

InvalidItemException

public InvalidItemException(int reason,
                            java.lang.String message,
                            ChargingResult chargingResult)
Constructs an exception with an error code and a message; The message contains a human readable text. It explains the reason why the charge process is forbidden, and it provides a structured information in the ChargingResult.

Parameters:
message - The message
reason - The error
chargingResult - The ChargingResult which provides structured information about the exception

InvalidItemException

public InvalidItemException(int reason,
                            java.lang.String message,
                            IError error)
Constructs an exception with an error code and a message; The message contains a human readable text.

Parameters:
message - The message
reason - The reason
error - The error associated to this exception

InvalidItemException

public InvalidItemException(int reason,
                            java.lang.String message,
                            IError error,
                            ChargingResult chargingResult)
Constructs an exception with a cause, a message, an error, and a ChargingResult that explain why the charging is forbidden. The message contains a human readable text. It explains the reason why the charge process is forbidden, and it provides a structured information in the ChargingResult.

Parameters:
reason - The reason
message - The message
error - The error code
chargingResult - The ChargingResult which provides structured information about the exception
Method Detail

getError

@Deprecated
public int getError()
Deprecated. Use getReason() instead. Deprecated since version 3.0.

Returns the reason why the rating context is invalid.

Returns:
The error code
See Also:
BAD_CONFIGURATION, WRONG_PROPERTY_TYPE, PROPERTY_NOT_FOUND, UNRATED, DIVISION_BY_ZERO, INCOMPATIBLE_CURRENCIES, CI_NULL, INVALID_PROPERTY_VALUE

getReason

public int getReason()
Returns the reason why the rating context is invalid.

Returns:
The error code
See Also:
BAD_CONFIGURATION, WRONG_PROPERTY_TYPE, PROPERTY_NOT_FOUND, UNRATED, DIVISION_BY_ZERO, INCOMPATIBLE_CURRENCIES, CI_NULL, INVALID_PROPERTY_VALUE

getMessage

public java.lang.String getMessage()
Returns the detailed message explaining why the rating context is invalid.

Overrides:
getMessage in class java.lang.Throwable
Returns:
The detailed message

getIError

public IError getIError()
Gets the error contained in this Exception.

Returns:
The error contained in this exception

setError

public void setError(IError error)
Sets the error contained in this Exception.

Parameters:
error - The error contained in this exception

getChargingResult

public ChargingResult getChargingResult()
Description copied from interface: IChargingResultHolderException
Returns the ChargingResult that provides structured information about the exception.

Example

The ForbiddenChargeException and InvalidItemException exceptions include such a charging result complex object.

Specified by:
getChargingResult in interface IChargingResultHolderException
Returns:
The ChargingResult that provides structured information about the exception

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the element being processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - The XML attributes of the current element

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - The character data to be added

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the object, the child representing the marshallable object which must be added to the element.

Specified by:
addChild in interface XMLMarshallable
Parameters:
tagName - The name of tag for the child
child - The child to be added

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, including its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)